package com.qf.zhijia.service.impl;

import com.qf.zhijia.mapper.ProductMapper;
import com.qf.zhijia.pojo.Product;
import com.qf.zhijia.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Canaan
 * @version V1.0
 * @data 2020/09/05
 **/
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    ProductMapper productMapper;

    /**
     * 查询该商品
     * @return
     */
    @Override
    public Product findById(Integer pId) {
        System.out.println("开始查询");
        Product product = productMapper.selectById(pId);
        if (product != null){
            System.out.println("查询成功");
            return product;
        }
            System.out.println("查询为空");

        return product;
    }
}
